/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ejercicio.practica3;

/**
 *
 * @author manolo
 */
public class UsaCajero {

    public static void main(String[] args) {
        Cuenta_Banca2 cb = new Cuenta_Banca2(12345, 10000, "Manolo");

        System.out.println("El saldo inicial es: " + cb.Saldo());

        Thread cajeroA = new Thread(new Cajero(0, 1000, cb));
        Thread cajeroB = new Thread(new Cajero(1, 1000, cb));

        cajeroA.start();
        cajeroB.start();

        try {
            cajeroA.join();
            cajeroB.join();
        } catch (InterruptedException ex) {
            System.out.println("Se ha producido un error");
        }

        System.out.println("El saldo final es: " + cb.Saldo());
    }

}
